package mazegame;

import java.util.Map;
import java.util.Map.Entry;

public class MazeUtil {
	
	public static String log(String entry, String curLog)
    {
        if (curLog.length() > 500)
            return entry + "\n";
        else
            return curLog + entry + "\n";
    }
	
	public static <T, E> T getKeyByValue(Map<T, E> map, E value) {
	    for (Entry<T, E> entry : map.entrySet()) {
	        if (value.equals(entry.getValue())) {
	            return entry.getKey();
	        }
	    }
	    return null;
	}

}
